home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / inetutil.1 / inetutil / inetutils-1.1 / telnetd / ext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-12  |  7.1 KB  |  247 lines

  1. /*
  2.  * Copyright (c) 1989, 1993
  3.  *    The Regents of the University of California.  All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  *
  33.  *    @(#)ext.h    8.2 (Berkeley) 12/15/93
  34.  */
  35.  
  36. /*
  37.  * Telnet server variable declarations
  38.  */
  39. extern char    options[256];
  40. extern char    do_dont_resp[256];
  41. extern char    will_wont_resp[256];
  42. extern int    linemode;    /* linemode on/off */
  43. #ifdef    LINEMODE
  44. extern int    uselinemode;    /* what linemode to use (on/off) */
  45. extern int    editmode;    /* edit modes in use */
  46. extern int    useeditmode;    /* edit modes to use */
  47. extern int    alwayslinemode;    /* command line option */
  48. # ifdef    KLUDGELINEMODE
  49. extern int    lmodetype;    /* Client support for linemode */
  50. # endif    /* KLUDGELINEMODE */
  51. #endif    /* LINEMODE */
  52. extern int    flowmode;    /* current flow control state */
  53. extern int    restartany;    /* restart output on any character state */
  54. #ifdef DIAGNOSTICS
  55. extern int    diagnostic;    /* telnet diagnostic capabilities */
  56. #endif /* DIAGNOSTICS */
  57. #ifdef BFTPDAEMON
  58. extern int    bftpd;        /* behave as bftp daemon */
  59. #endif /* BFTPDAEMON */
  60. #if    defined(SecurID)
  61. extern int    require_SecurID;
  62. #endif
  63. #if    defined(AUTHENTICATION)
  64. extern int    auth_level;
  65. #endif
  66.  
  67. extern slcfun    slctab[NSLC + 1];    /* slc mapping table */
  68.  
  69. char    *terminaltype;
  70.  
  71. /*
  72.  * I/O data buffers, pointers, and counters.
  73.  */
  74. extern char    ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
  75.  
  76. extern char    netibuf[BUFSIZ], *netip;
  77.  
  78. extern char    netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp;
  79. extern char    *neturg;        /* one past last bye of urgent data */
  80.  
  81. extern int    pcc, ncc;
  82.  
  83. #if defined(CRAY2) && defined(UNICOS5)
  84. extern int unpcc;  /* characters left unprocessed by CRAY-2 terminal routine */
  85. extern char *unptyip;  /* pointer to remaining characters in buffer */
  86. #endif
  87.  
  88. extern int    pty, net;
  89. extern char    *line;
  90. extern int    SYNCHing;        /* we are in TELNET SYNCH mode */
  91.  
  92. #ifndef    P
  93. # ifdef    __STDC__
  94. #  define P(x)    x
  95. # else
  96. #  define P(x)    ()
  97. # endif
  98. #endif
  99.  
  100. extern void
  101.     _termstat P((void)),
  102.     add_slc P((int, int, int)),
  103.     check_slc P((void)),
  104.     change_slc P((int, int, int)),
  105.     cleanup P((int)),
  106.     clientstat P((int, int, int)),
  107.     copy_termbuf P((char *, int)),
  108.     deferslc P((void)),
  109.     defer_terminit P((void)),
  110.     do_opt_slc P((unsigned char *, int)),
  111.     doeof P((void)),
  112.     dooption P((int)),
  113.     dontoption P((int)),
  114.     edithost P((char *, char *)),
  115.     fatal P((int, char *)),
  116.     fatalperror P((int, char *)),
  117.     get_slc_defaults P((void)),
  118.     init_env P((void)),
  119.     init_termbuf P((void)),
  120.     interrupt P((void)),
  121.     localstat P((void)),
  122.     flowstat P((void)),
  123.     netclear P((void)),
  124.     netflush P((void)),
  125. #ifdef DIAGNOSTICS
  126.     printoption P((char *, int)),
  127.     printdata P((char *, char *, int)),
  128.     printsub P((int, unsigned char *, int)),
  129. #endif
  130.     ptyflush P((void)),
  131.     putchr P((int)),
  132.     putf P((char *, char *)),
  133.     recv_ayt P((void)),
  134.     send_do P((int, int)),
  135.     send_dont P((int, int)),
  136.     send_slc P((void)),
  137.     send_status P((void)),
  138.     send_will P((int, int)),
  139.     send_wont P((int, int)),
  140.     sendbrk P((void)),
  141.     sendsusp P((void)),
  142.     set_termbuf P((void)),
  143.     start_login P((char *, int, char *)),
  144.     start_slc P((int)),
  145. #if    defined(AUTHENTICATION)
  146.     start_slave P((char *)),
  147. #else
  148.     start_slave P((char *, int, char *)),
  149. #endif
  150.     suboption P((void)),
  151.     telrcv P((void)),
  152.     ttloop P((void)),
  153.     tty_binaryin P((int)),
  154.     tty_binaryout P((int));
  155.  
  156. extern int
  157.     end_slc P((unsigned char **)),
  158.     getnpty P((void)),
  159. #ifndef convex
  160.     getpty P((int *)),
  161. #endif
  162.     login_tty P((int)),
  163.     spcset P((int, cc_t *, cc_t **)),
  164.     stilloob P((int)),
  165.     terminit P((void)),
  166.     termstat P((void)),
  167.     tty_flowmode P((void)),
  168.     tty_restartany P((void)),
  169.     tty_isbinaryin P((void)),
  170.     tty_isbinaryout P((void)),
  171.     tty_iscrnl P((void)),
  172.     tty_isecho P((void)),
  173.     tty_isediting P((void)),
  174.     tty_islitecho P((void)),
  175.     tty_isnewmap P((void)),
  176.     tty_israw P((void)),
  177.     tty_issofttab P((void)),
  178.     tty_istrapsig P((void)),
  179.     tty_linemode P((void));
  180.  
  181. extern void
  182.     tty_rspeed P((int)),
  183.     tty_setecho P((int)),
  184.     tty_setedit P((int)),
  185.     tty_setlinemode P((int)),
  186.     tty_setlitecho P((int)),
  187.     tty_setsig P((int)),
  188.     tty_setsofttab P((int)),
  189.     tty_tspeed P((int)),
  190.     willoption P((int)),
  191.     wontoption P((int)),
  192.     writenet P((unsigned char *, int));
  193.  
  194. #ifdef    ENCRYPTION
  195. extern void    (*encrypt_output) P((unsigned char *, int));
  196. extern int    (*decrypt_input) P((int));
  197. extern char    *nclearto;
  198. #endif    /* ENCRYPTION */
  199.  
  200.  
  201. /*
  202.  * The following are some clocks used to decide how to interpret
  203.  * the relationship between various variables.
  204.  */
  205.  
  206. extern struct {
  207.     int
  208.     system,            /* what the current time is */
  209.     echotoggle,        /* last time user entered echo character */
  210.     modenegotiated,        /* last time operating mode negotiated */
  211.     didnetreceive,        /* last time we read data from network */
  212.     ttypesubopt,        /* ttype subopt is received */
  213.     tspeedsubopt,        /* tspeed subopt is received */
  214.     environsubopt,        /* environ subopt is received */
  215.     oenvironsubopt,        /* old environ subopt is received */
  216.     xdisplocsubopt,        /* xdisploc subopt is received */
  217.     baseline,        /* time started to do timed action */
  218.     gotDM;            /* when did we last see a data mark */
  219. } clocks;
  220.  
  221.  
  222. #if    defined(CRAY2) && defined(UNICOS5)
  223. extern int    needtermstat;
  224. #endif
  225.  
  226. #ifndef    DEFAULT_IM
  227. # ifdef HAVE_UNAME
  228.    /* Prefix and suffix if the IM string can be generated from uname.  */
  229. #  define UNAME_IM_PREFIX "\r\n"
  230. #  define UNAME_IM_SUFFIX " (%h) (%t)\r\n\n"
  231. # else /* ! HAVE_UNAME */
  232. #  ifdef CRAY
  233. #   define DEFAULT_IM    "\r\n\r\nCray UNICOS (%h) (%t)\r\n\r\r\n\r"
  234. #  else
  235. #   ifdef sun
  236. #    define DEFAULT_IM    "\r\n\r\nSunOS UNIX (%h) (%t)\r\n\r\r\n\r"
  237. #   else
  238. #    ifdef ultrix
  239. #     define DEFAULT_IM    "\r\n\r\nULTRIX (%h) (%t)\r\n\r\r\n\r"
  240. #    else
  241. #     define DEFAULT_IM    "\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r"
  242. #    endif
  243. #   endif
  244. #  endif
  245. # endif
  246. #endif
  247.